p
  = link_to '新增', new_village_path, class: "btn btn-info btn-xs"
= paginate @villages
table.table.table-inverse.table-striped.table-bordered.table-hover
  thead
    tr
      th 小区名
      th 地址
      th 主管理员
      th 楼栋管理员
      th 操作
  tbody
    - @villages.each do |village|
      tr
        td = village.name
        td = village.address
        td = village.editors.with_role(:estate).pluck(:name).join(', ')
        td = village.editors.with_role(:floor).pluck(:name).join(', ')
        td
          = link_to '删除', village_path(village), data: {:confirm => 'Are you sure?'}, :method => :delete, class: "btn btn-danger btn-xs"

          = link_to '修改', edit_village_path(village), class: "btn btn-warning btn-xs"
